import { RouteView } from '@/layouts'
export default {
  components: {
    RouteView,
  },
  data() {
    return {
      // 显示默认menu-active
      selectedKeys: [],
    }
  },
  computed: {
    pathList() {
      return this.routeList.map(item => item.path)
    }
  },
  mounted() {
    this.updateMenu()
  },
  methods: {
    updateMenu() {
      const routes = this.$route.matched.concat()
      this.selectedKeys = [routes.pop().path]
    },
  },
  watch: {
    $route(val) {
      this.updateMenu()
    },
  },
}
